/* GUI CONVERTED from rciq1a.i (converter v1.76) Fri May  3 13:21:16 2002 */
/* rciq1a.i - Release Management Customer Schedules                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.9.1.11 $                                                         */
/*V8:ConvertMode=Report                                                       */
/* REVISION: 7.0    LAST MODIFIED: 01/29/92           BY: WUG *F110*          */
/* REVISION: 7.0    LAST MODIFIED: 03/16/92           BY: WUG *F312*          */
/* REVISION: 7.0    LAST MODIFIED: 04/20/92           BY: WUG *F416*          */
/* REVISION: 7.3    LAST MODIFIED: 10/13/92           BY: WUG *G462*          */
/* REVISION: 7.4    LAST MODIFIED: 09/29/93           BY: WUG *H142*          */
/* REVISION: 7.4    LAST MODIFIED: 06/14/94           BY: dpm *FO75*          */
/* REVISION: 7.4    LAST MODIFIED: 06/14/94           BY: dpm *FO82*          */
/*                                 08/27/94           BY: BCM *GL61*          */
/* REVISION: 7.4    LAST MODIFIED: 10/25/94           BY: rxm *GN17*          */
/* REVISION: 7.4    LAST MODIFIED: 10/31/94           BY: qzl *GN75*          */
/* REVISION: 7.4    LAST MODIFIED: 12/15/94           BY: rxm *GN16*          */
/* REVISION: 7.4    LAST MODIFIED: 03/22/95           BY: aed *G0J0*          */
/* REVISION: 7.4    LAST MODIFIED: 03/29/95           BY: bcm *G0JS*          */
/* REVISION: 7.4    LAST MODIFIED: 04/03/95           BY: jpm *G0K2*          */
/* REVISION: 7.4    LAST MODIFIED: 04/21/95           BY: jpm *H0D5*          */
/* REVISION: 8.5    LAST MODIFIED: 04/24/95           BY: dpm *J044*          */
/* REVISION: 7.4    LAST MODIFIED: 06/08/95           BY: dxk *G0PP*          */
/* REVISION: 7.4    LAST MODIFIED: 09/16/95           BY: vrn *G0X9*          */
/* REVISION: 7.3    LAST MODIFIED: 10/11/95           BY: vrn *G0Z0*          */
/* REVISION: 7.3    LAST MODIFIED: 10/18/95           BY: vrn *G0Z6*          */
/* REVISION: 7.4    LAST MODIFIED: 10/22/95           BY: vrn *G0YL*          */
/* REVISION: 8.6    LAST MODIFIED: 09/20/96           BY: TSI *K005*          */
/* REVISION: 8.6      LAST MODIFIED: 10/15/96   BY: *G2GJ* Ajit Deodhar       */
/* REVISION: 8.6      LAST MODIFIED: 09/23/97   by: *K0J8* Jean Miller        */
/* REVISION: 8.6      LAST MODIFIED: 10/07/97   by: *K0ML* Beena Mol          */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 06/22/98   BY: *K1SW* A. Shobha          */
/* REVISION: 8.6E     LAST MODIFIED: 04/06/99   BY: *K208* Surekha Joshi      */
/* REVISION: 8.6E     LAST MODIFIED: 07/14/99   BY: *K21L* Abbas Hirkani      */
/* REVISION: 8.6E     LAST MODIFIED: 08/19/99   BY: *K229* Surekha Joshi      */
/* REVISION: 9.1      LAST MODIFIED: 10/11/99   BY: *N03H* A. Philips         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 05/12/00   BY: *N09X* Antony Babu        */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown         */
/* REVISION: 9.1      LAST MODIFIED: 09/05/00   BY: *N0R9* Mudit Mehta        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.9.1.10     BY: Jean Miller    DATE: 03/22/01 ECO: *P008*       */
/* $Revision: 1.9.1.11 $    BY: Katie Hilbert  DATE: 04/15/02 ECO: *P03J*       */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/* REPORT/INQUIRY DISPLAY INCLUDE */
define input parameter schtype      like sch_type.
define input parameter schnbr       like sch_nbr.
define input parameter schline      like sch_line.
define input parameter schrlseid    like sch_rlse_id.
define input parameter show_net_req like mfc_logical.

define variable impexp              like mfc_logical             no-undo.
define variable impexp_label        as   character format "x(8)" no-undo.
define variable l_desc1             like pt_desc1                no-undo.
define variable cmmts               like soc_hcmmts label "Comments".
define variable rqmts               as   logical                 no-undo.
define variable i                   as   integer                 no-undo.

define variable prior_cum_net_req   like sch_pcr_qty             no-undo.
define variable disp_qty            like schd_upd_qty            no-undo.
define variable prior_disp_qty      like sch_pcr_qty             no-undo.
define variable schedule_type       as   character extent 3      no-undo.
define variable detail_frame_titles as   character extent 3      no-undo.
define variable detail_frame_title  as   character               no-undo.

define variable lr_asn              like sch_lr_asn  extent 0    no-undo.
define variable lr_date             like sch_lr_date extent 0    no-undo.
define variable lr_time             like sch_lr_time extent 0    no-undo.
define variable lr_qty              like sch_lr_qty  extent 0    no-undo.
define variable lr_cum_qty          like sch_lr_cum_qty extent 0 no-undo.
define variable frame_lines         as integer                   no-undo.

define variable detail_title        as character                 no-undo.

{rcordfrm.i}

assign
   schedule_type[1] = " " + getTermLabel("CUSTOMER_PLAN_SCHEDULE",30)
   schedule_type[2] = " " + getTermLabel("CUSTOMER_SHIP_SCHEDULE",30)
   schedule_type[3] = " " + getTermLabel("REQUIRED_SHIP_SCHEDULE",30).

detail_frame_titles[1] = getFrameTitle("NET_REQUIRED_QUANTITIES",32).
detail_frame_titles[2] = getFrameTitle("CUM_REQUIRED_QUANTITIES",32).
detail_frame_titles[3] = getFrameTitle("REQUIRED_QUANTITIES",27).
detail_title           = getFrameTitle("SCHEDULE_DETAIL_DATA",28).

FORM /*GUI*/  with STREAM-IO /*GUI*/  frame schd1c down attr-space width 80
   title color normal detail_title.
FORM /*GUI*/  with STREAM-IO /*GUI*/  frame schd2c down attr-space width 80
   title color normal detail_title.
FORM /*GUI*/  with STREAM-IO /*GUI*/  frame schd3c down attr-space width 80
   title color normal detail_title.

FORM /*GUI*/ 
   rqm_date
   rqm_time
   rqm_interval       column-label "Int"
   rqm_reference      format "x(19)"
   rqm_det.rqm_cat    format "x(8)"
   rqm_value          format "x(24)"
with STREAM-IO /*GUI*/  frame rqmdet down attr-space width 80
title color normal (getFrameTitle("REQUIREMENT_DETAIL_DATA",33)).

/* SET EXTERNAL LABELS */
setFrameLabels(frame rqmdet:handle).

FORM /*GUI*/ 
   cmt_cmmt[1] no-label
with STREAM-IO /*GUI*/  frame cmmts_data down width 80 attr-space
title color normal (getFrameTitle("TRANSACTION_COMMENTS",29)).

FORM /*GUI*/  with STREAM-IO /*GUI*/  with frame lastreceipt width 80 attr-space frame_lines down
title color normal (getFrameTitle("CUSTOMER_RECEIPTS",25)).

/* SET EXTERNAL LABELS */
setFrameLabels(frame lastreceipt:handle).

program:
do on endkey undo, leave program:

   find sch_mstr where
        sch_type = schtype
     and sch_nbr = schnbr
     and sch_line = schline
     and sch_rlse_id = schrlseid
   no-lock no-error.

   if not available sch_mstr
      then undo, leave.

   find so_mstr where so_nbr = sch_nbr no-lock no-error.

   find sod_det where sod_nbr = sch_nbr and
                      sod_line = sch_line
   no-lock no-error.

   find scx_ref where scx_type = 1 and
                      scx_order = sod_nbr
                  and scx_line = sod_line
   no-lock no-error.

   find si_mstr where si_site = scx_shipfrom no-lock no-error.

   find ad_mstr where ad_addr = scx_shipto no-lock no-error.

   find pt_mstr where pt_part = scx_part no-lock no-error.
   if available pt_mstr then
      l_desc1 = pt_desc1.
   else
   if available sod_det then
      l_desc1 = sod_desc.
   else
      l_desc1 = "".

   if show_net_req then
      detail_frame_title = detail_frame_titles[1].
   else
   if sch_cumulative then
      detail_frame_title = detail_frame_titles[2].
   else
      detail_frame_title = detail_frame_titles[3].

   cmmts = sch_cmtindx > 0.

   FORM /*GUI*/ 
      {rcordfma.i}
             skip(.4)  
      sch_rlse_id colon 46
             skip(.4)  
   with STREAM-IO /*GUI*/  frame prm side-labels width 80 attr-space.

   /* SET EXTERNAL LABELS */
   setFrameLabels(frame prm:handle).

   display
      {1}
      scx_shipfrom
      scx_shipto
      ad_name          when (available ad_mstr)
      scx_part
      l_desc1 @ sod_desc
      sod_custpart     when (available sod_det)
      pt_um            when (available pt_mstr)
      scx_po
      sch_rlse_id
      scx_order
      scx_custref
      scx_modelyr
      scx_line
   with frame prm
   title schedule_type[sch_type] + "-" + detail_frame_title STREAM-IO /*GUI*/ .

   
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


   if sch_type = 1 then do:

      /* CUSTOMER PLAN SCHEDULE */
      if show_net_req then
         prior_disp_qty = max(sch_pcr_qty - sod_cum_qty[1],0).
      else
         prior_disp_qty = sch_pcr_qty.

      do with frame sched1_data:

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame sched1_data:handle).

         display {1}
            cmmts          colon 20
            sch_cr_date    colon 55
            string(sch_cr_time,"HH:MM:SS") format "x(8)"
               @ sch_cr_time    no-label
            sch_sd_pat     colon 20 label "SDP Code"
            sch_cumulative colon 55
            sch_sd_time    colon 20 label "SDT Code"
            sch_prp_int    colon 20
            sch_prp_ext    colon 20
            sch_sd_dates   colon 55
            prior_disp_qty colon 20
            sch_eff_start  colon 55 label "Active Start"
            sch_pcs_date   colon 20
            sch_eff_end    colon 55 label "Active End"
         with frame sched1_data attr-space side-labels width 80 STREAM-IO /*GUI*/ .

      end. /* do with frame */

      
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


      hide {1} frame sched1_data.

      clear frame cmmts_data all no-pause.

      for each cmt_det no-lock where cmt_indx = sch_cmtindx:

         do i = 1 to 15:
            if cmt_cmmt[i] > "" then do:
               display {1}
                  cmt_cmmt[i] @ cmt_cmmt[1]
               with frame cmmts_data STREAM-IO /*GUI*/ .
               down {1} 1 with frame cmmts_data.
               
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/

            end.
         end.
      end.

      hide {1} frame cmmts_data.

      /* DISPLAY CUSTOMER RECEIPT DATA */
      clear frame lastreceipt all no-pause.
      frame_lines = 0.

      do i = 1 to 9:
         if sch_lr_asn[i] <> ""
         or sch_lr_date[i] <> ?
         or sch_lr_time[i] <> ""
         or sch_lr_qty[i] <> 0
         or sch_lr_cum_qty[i] <> 0
         then
            frame_lines = frame_lines + 1.
      end.

      do i = 1 to 9:

         if sch_lr_asn[i] <> ""
         or sch_lr_date[i] <> ?
         or sch_lr_time[i] <> ""
         or sch_lr_qty[i] <> 0
         or sch_lr_cum_qty[i] <> 0
         then do:

            display {1}
               sch_lr_asn[i]     @ lr_asn
               sch_lr_date[i]    @ lr_date
               sch_lr_time[i]    @ lr_time
               sch_lr_qty[i]     @ lr_qty
               sch_lr_cum_qty[i] @ lr_cum_qty
            with frame lastreceipt STREAM-IO /*GUI*/ .

            down {1} with frame lastreceipt.

         end.

      end.

      if frame_lines > 0 then hide {1} frame lastreceipt.

      
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


      clear frame schd1c all no-pause.

      for each schd_det no-lock
         where schd_type = sch_type
           and schd_nbr = sch_nbr
           and schd_line = sch_line
           and schd_rlse_id = sch_rlse_id:

         /* CHECK FOR REQUIREMENT DETAIL */
         {gprun.i ""rcrqmyn.p""
            "(input recid(schd_det), input-output rqmts)"}

         cmmts = schd_cmtindx > 0.

         if show_net_req then do:
            disp_qty =
               max(min(schd_discr_qty, schd_cum_qty - sod_cum_qty[1]),0).
         end.
         else
         if sch_cumulative then
            disp_qty = schd_cum_qty.
         else
            disp_qty = schd_discr_qty.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame schd1c:handle).
         display {1}
            schd_date
            schd_time
            schd_interval  column-label "Int"
            schd_reference format "x(24)"
            disp_qty
            schd_fc_qual
            cmmts          label "Cmt"
            rqmts          column-label "Rqm!Det"
         with frame schd1c STREAM-IO /*GUI*/ .

         down {1} 1 with frame schd1c.

         
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


         if schd_cmtindx > 0 then do:

            clear frame cmmts_data all no-pause.

            for each cmt_det no-lock where cmt_indx = schd_cmtindx:

               do i = 1 to 15:
                  if cmt_cmmt[i] > "" then do:
                     display {1} cmt_cmmt[i] @ cmt_cmmt[1]
                     with frame cmmts_data STREAM-IO /*GUI*/ .
                     down {1} 1 with frame cmmts_data.
                     
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/

                  end.
               end.

            end.

            hide {1} frame cmmts_data.

         end.

      end.

      hide {1} frame schd1c.

      for each rqm_det
         where rqm_type     = sch_type
           and rqm_nbr      = sch_nbr
           and rqm_line     = sch_line
           and rqm_rlse_id  = sch_rlse_id
      no-lock:

         display {1}
            rqm_date
            rqm_time
            rqm_interval
            rqm_reference
            rqm_det.rqm_cat
            rqm_value
         with frame rqmdet STREAM-IO /*GUI*/ .

         down {1} 1 with frame rqmdet.

         
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


      end.

      hide {1} frame rqmdet.

      if keyfunction(lastkey) = "END-ERROR" then
         leave program.

      FORM /*GUI*/ 
         sch_fab_qty       colon 11
         sch_fab_strt      colon 39
         sch_fab_end       colon 60       skip(1)  
         sch_raw_qty       colon 11
         sch_raw_strt      colon 39
         sch_raw_end       colon 60       skip(1)  
      with STREAM-IO /*GUI*/  frame res_auth_data width 80
      title color normal (getFrameTitle("RESOURCE_AUTHORIZATION_DATA",38))
      attr-space side-labels.

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame res_auth_data:handle).

      display {1}
         sch_fab_qty
         sch_fab_strt
         sch_fab_end
         sch_raw_qty
         sch_raw_strt
         sch_raw_end
      with frame res_auth_data STREAM-IO /*GUI*/ .

      
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


      hide {1} frame res_auth_data.

   end.

   else
   if sch_type = 2 then do:

      /* CUSTOMER SHIP SCHEDULE */
      if show_net_req then
         prior_disp_qty = max(sch_pcr_qty - sod_cum_qty[1],0).
      else
         prior_disp_qty = sch_pcr_qty.

      do with frame sched2_data:

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame sched2_data:handle).

         display {1}
            cmmts          colon 20
            sch_cr_date    colon 55
            string(sch_cr_time,"HH:MM:SS") format "x(8)" @
            sch_cr_time    no-label
            sch_sd_pat     colon 20 label "SDP Code"
            sch_cumulative colon 55
            sch_sd_time    colon 20 label "SDT Code"
            sch_prp_int    colon 20
            sch_prp_ext    colon 20
            sch_sd_dates   colon 55
            prior_disp_qty colon 20
            sch_eff_start  colon 55 label "Active Start"
            sch_pcs_date   colon 20
            sch_eff_end    colon 55 label "Active End"
         with frame sched2_data attr-space side-labels width 80 STREAM-IO /*GUI*/ .

      end. /* do with */

      
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


      hide {1} frame sched2_data.

      clear frame cmmts_data all no-pause.

      for each cmt_det no-lock where cmt_indx = sch_cmtindx:
         do i = 1 to 15:
            if cmt_cmmt[i] > "" then do:
               display {1} cmt_cmmt[i] @ cmt_cmmt[1]
               with frame cmmts_data STREAM-IO /*GUI*/ .
               down {1} 1 with frame cmmts_data.
               
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/

            end.
         end.
      end.

      hide {1} frame cmmts_data.

      /* DISPLAY CUSTOMER RECEIPT DATA */
      clear frame lastreceipt all no-pause.
      frame_lines = 0.

      do i = 1 to 9:
         if sch_lr_asn[i] <> ""
         or sch_lr_date[i] <> ?
         or sch_lr_time[i] <> ""
         or sch_lr_qty[i] <> 0
         or sch_lr_cum_qty[i] <> 0
         then
            frame_lines = frame_lines + 1.
      end.

      do i = 1 to 9:
         if sch_lr_asn[i] <> ""
         or sch_lr_date[i] <> ?
         or sch_lr_time[i] <> ""
         or sch_lr_qty[i] <> 0
         or sch_lr_cum_qty[i] <> 0
         then do:
            display {1}
               sch_lr_asn[i]     @ lr_asn
               sch_lr_date[i]    @ lr_date
               sch_lr_time[i]    @ lr_time
               sch_lr_qty[i]     @ lr_qty
               sch_lr_cum_qty[i] @ lr_cum_qty
            with frame lastreceipt STREAM-IO /*GUI*/ .

            down {1} with frame lastreceipt.
         end.
      end.

      if frame_lines > 0 then hide {1} frame lastreceipt.

      clear frame schd2c all no-pause.

      for each schd_det no-lock
         where schd_type = sch_type
           and schd_nbr  = sch_nbr
           and schd_line = sch_line
           and schd_rlse_id = sch_rlse_id:

         /* CHECK FOR REQUIREMENT DETAIL */
         {gprun.i ""rcrqmyn.p""
            "(input recid(schd_det), input-output rqmts)"}

         cmmts = schd_cmtindx > 0.

         if show_net_req then do:
            disp_qty =
               max(min(schd_discr_qty, schd_cum_qty - sod_cum_qty[1]),0).
         end.
         else
         if sch_cumulative then
            disp_qty = schd_cum_qty.
         else
            disp_qty = schd_discr_qty.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame schd2c:handle).

         display {1}
            schd_date
            schd_time
            schd_interval  column-label "Int"
            schd_reference format "x(24)"
            disp_qty
            schd_fc_qual
            cmmts          label "Cmt"
            rqmts          column-label "Rqm!Det"
         with frame schd2c STREAM-IO /*GUI*/ .

         down {1} 1 with frame schd2c.
         
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


         if schd_cmtindx > 0 then do:

            clear frame cmmts_data all no-pause.

            for each cmt_det no-lock where cmt_indx = schd_cmtindx:
               do i = 1 to 15:
                  if cmt_cmmt[i] > "" then do:
                     display {1} cmt_cmmt[i] @ cmt_cmmt[1]
                     with frame cmmts_data STREAM-IO /*GUI*/ .
                     down {1} 1 with frame cmmts_data.
                     
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/

                  end.
               end.
            end.

            hide {1} frame cmmts_data.

         end.

      end.

      hide {1} frame schd2c.

      for each rqm_det
         where rqm_type     = sch_type
           and rqm_nbr      = sch_nbr
           and rqm_line     = sch_line
           and rqm_rlse_id  = sch_rlse_id
      no-lock:

         display {1}
            rqm_date
            rqm_time
            rqm_interval
            rqm_reference
            rqm_det.rqm_cat
            rqm_value
         with frame rqmdet STREAM-IO /*GUI*/ .

         down {1} 1 with frame rqmdet.

         
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


      end.

      hide {1} frame rqmdet.

      if keyfunction(lastkey) = "END-ERROR" then
         leave program.

   end.

   else
   if sch_type = 3 then do:

      /* REQUIRED SHIP SCHEDULE */
      if show_net_req then
         prior_disp_qty = max(sch_pcr_qty - sod_cum_qty[1],0).
      else
         prior_disp_qty = sch_pcr_qty.

      do with frame sched3_data:

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame sched3_data:handle).

         display {1}
            cmmts          colon 20
            sch_cr_date    colon 55
            string(sch_cr_time,"HH:MM:SS") format "x(8)" @
            sch_cr_time    no-label
            sch_cumulative colon 55
            sch_pcr_qty    colon 20
            sch_eff_start  colon 55 label "Active Start"
            sch_pcs_date   colon 20
            sch_eff_end    colon 55 label "Active End"
            sch_from_pid   colon 20
            sch_from_sid   colon 20
                  skip(.4)   
         with frame sched3_data attr-space side-labels width 80 STREAM-IO /*GUI*/ .

      end. /* do with  */

      
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


      hide {1} frame sched3_data.

      clear frame cmmts_data all no-pause.

      for each cmt_det no-lock where cmt_indx = sch_cmtindx:
         do i = 1 to 15:
            if cmt_cmmt[i] > "" then do:
               display
                  {1} cmt_cmmt[i] @ cmt_cmmt[1]
               with frame cmmts_data STREAM-IO /*GUI*/ .
               down {1} 1 with frame cmmts_data.
               
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/

            end.
         end.
      end.

      hide {1} frame cmmts_data.

      clear frame schd3c all no-pause.

      /* DO NOT DISPLAY/PRINT COMPLETELY SHIPPED SCHD_DET RECORDS */
      /* IN NEW RSS                                               */
      for each schd_det no-lock
         where schd_type                         = sch_type
           and schd_nbr                          = sch_nbr
           and schd_line                         = sch_line
           and schd_rlse_id                      = sch_rlse_id
           and trim(substring(schd_fc_qual,2,1)) = "":

         /* CHECK FOR REQUIREMENT DETAIL */
         {gprun.i ""rcrqmyn.p""
            "(input recid(schd_det), input-output rqmts)"}

         cmmts = schd_cmtindx > 0.

         if show_net_req then do:
            if so_cum_acct then
               disp_qty = maximum(min(schd_discr_qty,
                              schd_cum_qty - sod_cum_qty[1]),0).
            else
               disp_qty = maximum(schd_discr_qty - schd_ship_qty,0).
         end.
         else
         if sch_cumulative then
            disp_qty = schd_cum_qty.
         else
            disp_qty = schd_discr_qty.

         /* SET EXTERNAL LABELS */
         setFrameLabels(frame schd3c:handle).

         display {1}
            schd_date
            schd_time
            schd_interval  column-label "Int"
            schd_reference format "x(24)"
            disp_qty
            schd_fc_qual
            cmmts          label "Cmt"
            rqmts          column-label "Rqm!Det"
         with frame schd3c STREAM-IO /*GUI*/ .

         down {1} 1 with frame schd3c.

         
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


         if schd_cmtindx > 0 then do:
            clear frame cmmts_data all no-pause.

            for each cmt_det no-lock where cmt_indx = schd_cmtindx:
               do i = 1 to 15:
                  if cmt_cmmt[i] > "" then do:
                     display
                        {1} cmt_cmmt[i] @ cmt_cmmt[1]
                     with frame cmmts_data STREAM-IO /*GUI*/ .
                     down {1} 1 with frame cmmts_data.
                     
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/

                  end.
               end.
            end.

            hide {1} frame cmmts_data.
         end.
      end.

      hide {1} frame schd3c.

      for each rqm_det
         where rqm_type     = sch_type
           and rqm_nbr      = sch_nbr
           and rqm_line     = sch_line
           and rqm_rlse_id  = sch_rlse_id
      no-lock:

         /* DO NOT DISPLAY/PRINT REQUIREMENT DETAIL DATA FOR */
         /* COMPLETELY SHIPPED SCHD_DET RECORDS              */
         for first schd_det
         fields (schd_cmtindx schd_cum_qty schd_date schd_discr_qty
                 schd_fc_qual schd_interval schd_line schd_nbr
                 schd_reference schd_rlse_id schd_ship_qty
                 schd_time schd_type)
         where schd_type      = rqm_type     and
               schd_nbr       = rqm_nbr      and
               schd_line      = rqm_line     and
               schd_rlse_id   = rqm_rlse_id  and
               schd_date      = rqm_date     and
               schd_time      = rqm_time     and
               schd_interval  = rqm_interval and
               schd_reference = rqm_reference
         no-lock: end. /* FOR FIRST SCHD_DET */

         if available schd_det and
            trim(substring(schd_fc_qual,2,1)) = ""
         then do:

            display {1}
               rqm_date
               rqm_time
               rqm_interval
               rqm_reference
               rqm_det.rqm_cat
               rqm_value
            with frame rqmdet STREAM-IO /*GUI*/ .

            down {1} 1 with frame rqmdet.

            
/*GUI*/ {mfguichk.i  &warn=false &label=program} /*Replace mfrpchk*/


         end. /* IF AVAILABLE SCHD_DET AND */

      end.

      hide {1} frame rqmdet.

      if keyfunction(lastkey) = "END-ERROR" then
         leave program.

   end.

   hide {1} frame prm.
   page {1}.

end.

if keyfunction(lastkey) = "END-ERROR" then
   hide frame prm no-pause.
